﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Xna.Framework;

namespace TankIt
{
    public class Unmarshled
    {
        public Vector2 position=Vector2.Zero;
        public float rotation;
        public bool fire=false;


        public Unmarshled (String received)
        {
            try{
                string[] words = received.Split(' ');
                position.X = Convert.ToSingle(words[0]);
                position.Y = Convert.ToSingle(words[1]);
                rotation = Convert.ToSingle(words[2]);
                fire = (1==Convert.ToInt32(words[3]));
                if (Convert.ToInt32(words[4])==1)
                    position.X = -1;
            }
            catch (Exception ex){
                position.X = -1;
            }

        }


    }
}
